package xyz.penghaonan.wificonnect.connect;

public interface IConnectHelper {

    int STATE_OFF = 1; // 关闭
    int STATE_WIFI_LISTENING = 2;
    int STATE_WIFI_CONNECTING = 3;
    int STATE_WIFI_CONNECTED = 4;
    int STATE_SOCKET_CREATE = 5;
    int STATE_SOCKET_WAITING = 6;
    int STATE_SOCKET_CONNECTED = 7;
    int STATE_SOCKET_CONNECTING = 8;

    interface OnConnectStateChangedListener {
        void onStateChanged(int state);
    }

    void start();
    void stop();
    int getState();
    String getStateDesc();

    void addOnDeviceConnectStateListener(OnConnectStateChangedListener listener);

    void removeOnDeviceConnectStateListener(OnConnectStateChangedListener listener);
}
